<?php
include('./library/conn.php');
$sql = "select * from product";
$res = $mysqli->query($sql);

$mysqli->close();

$arr = array();

while($row = $res->fetch_assoc()){
    array_push($arr,$row);
}

$json = json_encode($arr);

echo $json;


?>